<template>
	<!-- 搜索组件-->
	<view class="px-0 pt-12">
		<tm-input focus-color="white" :text="false" color="white" :round="16"
				  :transprent="store.tmStore.dark" :placeholder="'搜索小说'"
				  showClear
				  prefix="tmicon-search" v-model="str" @confirm='search'></tm-input>
	</view>
</template>

<script>
	import {
		computed
	} from "vue"
	import tmSheet from "@/tmui/components/tm-sheet/tm-sheet.vue"
	import tmMessage from "@/tmui/components/tm-message/tm-message.vue"
	import tmSticky from "@/tmui/components/tm-sticky/tm-sticky.vue"
	import {useTmpiniaStore} from '@/tmui/tool/lib/tmpinia';
	const store = useTmpiniaStore();
	computed(() => {
	    if (store.tmStore.dark) {
	        return []
	    }
	    return store.tmStore.color ? [] : ['#f5f5f5', '#f5f5f5']
	
	});
	function search() {
		if (str.value.trim() === "") {
			msg.value?.show({
				model: "error",
				text: "不能为空",
				mask: true
			})
			return
		}
		uni.navigateTo({
			url: "search?key=" + str.value
		})
	}
	export default {
		
	}
</script>

<style>

</style>